{{include file="user/u_header.html"}}
<script type="text/javascript" src="res/js/formvalidator/formValidator-4.1.3.js"></script>
<script type="text/javascript">
                var times = 30;
                var isinerval;
                function CountDown() {
                    if (times < 1) {
                        $("#GetVerify").val("获取短信验证码").attr("disabled", false);
                        clearInterval(isinerval);
                        return;
                    }
                    $("#GetVerify").val(times+"秒后重获验证码");
                    times--;
                }
                function get_verify() {
                    $.get("user.php?ctl=safe&act=sms",{ random:Math.random()}, function(data){
                        if(data=="0") {
                           times = 30;
                            $("#GetVerify").attr("disabled", true);
                            isinerval = setInterval("CountDown()", 1000);
                        } else if(data=="-1") {
                            alert("你今天获取验证码次数已达到上限");
                        } else {
                            alert("短信发送失败");
                        }
                    });
                    
                }
   $(document).ready(function(){
            $.formValidator.initConfig({theme:"126",formID:"signup-user-form",mode:'AutoTip',onError:function(msg){alert(msg)},inIframe:true});
                $("#id_code").formValidator({onshow:"请输入手机收到的验证码",onfocus:"请输入手机收到的验证码"}).inputValidator({min:1,onerror:"请输入手机收到的验证码"}).ajaxValidator({
                    type : "get",
                    url : "user.php?",
                    data :"ctl=safe&act=sms&smsverify=1",
                    datatype : "html",
                    success : function(data){
                        if( data == "1" ) {
                            return true;
                        } else {
                            return false;
                        }
                    },
                    buttons: $("#dosubmit"),
                    onerror : "验证码错误",
                    onwait : "请稍候..."
                });
      });

</script>
<div class="w998 u_main clear">
	{{include file="user/u_leftMenu.html"}}	
    <!--右侧开始-->
    <div class="Fr right">
    支付密码  <br/>
    {{if $tp=='change'}}
    <form id="form1" name="form1" method="post" action="user.php?ctl=safe&act=paypasswd&tp=change">
        验证旧密码: <input type="password" name="oldpassword" />(登录密码)<br/>
        新密码: <input type="password" name="password" /><br/>
        确定新密码: <input type="password" name="password2" /><br/>
        <input type="submit" name="btnsubmit">
    </form>
    {{elseif $tp=='reset'}}
        <form action="user.php?{{$TIN_CTL}}=safe&{{$TIN_ACT}}=paypasswd&tp=reset" method="post" id="signup-user-form">
            <input type="button" id="GetVerify" value="发送验证码" onclick="get_verify()" /><br />
            <input type="text" name="id_code" id="id_code" /><br />
            新密码: <input type="password" name="password" />
            确定新密码: <input type="password" name="password2" />
            <input type="submit" name="btnsubmit" id="dosubmit" /><br />
        </form> 
    {{/if}}
    </div>
    <!--右侧结束-->
</div>
{{include file="user/u_footer.html"}}
